# -----------------------------------------------
# Author: yuz
# Copyright: 湖南零檬信息技术有限公司
# Email: wagyu2016@163.com
# Phone&Wechat: 18173179913
# Site: http://www.lemonban.com
# Forum: http://testingpai.com
# -----------------------------------------------
import requests
# /captcha.jpg?uuid=46d2c4f6-5e6d-4b56-83a3-6e16a2b0acd4
import uuid

# 直接使用 uuid4
uid = uuid.uuid4()
print(uid)

host = 'http://mall.lemonban.com:8108'
url = host + f'/captcha.jpg?uuid={uid}'

response = requests.request(method='GET',
                         url=url)

# 响应结果消息体，  二进制数据，   图片,音频，视频，直播流
# print(response.content)

with open('code.png', mode='wb') as f:
    f.write(response.content)


### 本身10万个、
# {"id": 1, "name": "sunshine"}
# {"id": 2, "name": "sunshine"}
# {"id": 3, "name": "sunshine"}